package com.lpit.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 收益表
 * @TableName earnings
 */
@TableName(value ="earnings")
@Data
public class Earnings implements Serializable {
    /**
     * 
     */
    @TableId
    private Integer id;

    /**
     * 收益来源id
     */
    private Integer sourceId;

    /**
     * 收益来源
     */
    private String earningsSource;

    /**
     * 收益金额
     */
    private Double earningsMoney;

    /**
     * 收益时间
     */
    private Date earningsTime;

    /**
     * 用户id
     */
    private Integer userId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Earnings other = (Earnings) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSourceId() == null ? other.getSourceId() == null : this.getSourceId().equals(other.getSourceId()))
            && (this.getEarningsSource() == null ? other.getEarningsSource() == null : this.getEarningsSource().equals(other.getEarningsSource()))
            && (this.getEarningsMoney() == null ? other.getEarningsMoney() == null : this.getEarningsMoney().equals(other.getEarningsMoney()))
            && (this.getEarningsTime() == null ? other.getEarningsTime() == null : this.getEarningsTime().equals(other.getEarningsTime()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSourceId() == null) ? 0 : getSourceId().hashCode());
        result = prime * result + ((getEarningsSource() == null) ? 0 : getEarningsSource().hashCode());
        result = prime * result + ((getEarningsMoney() == null) ? 0 : getEarningsMoney().hashCode());
        result = prime * result + ((getEarningsTime() == null) ? 0 : getEarningsTime().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", sourceId=").append(sourceId);
        sb.append(", earningsSource=").append(earningsSource);
        sb.append(", earningsMoney=").append(earningsMoney);
        sb.append(", earningsTime=").append(earningsTime);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}